<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>单据审批</title>
        <script type="text/javascript">
            function showProj(){
                window.open("./pubinfo/projList.jsf", "项目列表", "height=1024,width=800,toolbar=no,menubar=no,scrollbars=no");
            }
            function updateProjSelect(code,name){
                document.getElementById('tp:projCode').value = code;
                document.getElementById('tp:projName').value = name;
            }

            function showDept(){
                window.open("./pubinfo/departmentList.jsf", "部门列表", "height=1024,width=800,toolbar=no,menubar=no,scrollbars=no");
            }
            function updateDept(code,name){
                document.getElementById('tp:deptcode').value = code;
                document.getElementById('tp:deptname').value = name;
            }
        </script>
    </h:head>
    <h:body>
        <h:form id="tp">
            <rich:panel header="审批单据">
                <div style="height:500px;width:950px;overflow:auto">
                    <rich:dataTable id="tplist"
                                    value="#{checkBean.model}" var="tralist"
                                    rows="10"
                                    rowClasses="list-row-odd,list-row-even"
                                    headerClass="table-header" >
                        <rich:column sortBy="#{tralist.number}">
                            <f:facet name="header">单据编号</f:facet>
                            <h:outputText value="#{tralist.number}"/>
                        </rich:column>
                        <rich:column sortBy="#{tralist.voutype}">
                            <f:facet name="header">单据类型</f:facet>
                            <h:outputText value="报销单"    rendered="#{tralist.voutype == '0'}" style="color:red"/>
                            <h:outputText value="差旅费报销单"  rendered="#{tralist.voutype == '1'}" style="color:blue"/>
                            <h:outputText value="出国差旅费报销单"  rendered="#{tralist.voutype == '6'}" style="color:red"/>
                            <h:outputText value="借款单"  rendered="#{tralist.voutype == '3'}" style="color:green"/>
                            <h:outputText value="付款单"  rendered="#{tralist.voutype == '4'}" style="color:blue"/>
                            <h:outputText value="支付证明单"  rendered="#{tralist.voutype == '5'}" style="color:red"/>
                        </rich:column>
                        <rich:column sortBy="#{tralist.numDate}">
                            <f:facet name="header">单据日期</f:facet>
                            <h:outputText value="#{tralist.numDate}">
                                <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" locale="cn" />
                            </h:outputText>
                        </rich:column>
                        <rich:column sortBy="#{tralist.affair}">
                            <f:facet name="header">事由</f:facet>
                            <h:outputText value="#{tralist.affair}"/>
                        </rich:column>
                        <rich:column sortBy="#{tralist.total}">
                            <f:facet name="header">报销金额</f:facet>
                            <h:outputText value="#{tralist.total}">
                                <f:convertNumber type="number" pattern="#,##0.00"/>
                            </h:outputText>
                        </rich:column>
                        <rich:column sortBy="#{tralist.project.projname}">
                            <f:facet name="header">预算项目</f:facet>
                            <h:outputText value="#{tralist.project.projname}"/>
                        </rich:column>
                        <rich:column sortBy="#{tralist.payDept.name}">
                            <f:facet name="header">费用承担部门</f:facet>
                            <h:outputText value="#{tralist.payDept.name}"/>
                        </rich:column>
                        <rich:column sortBy="#{tralist.user.cpsn_name}">
                            <f:facet name="header">填单人员</f:facet>
                            <h:outputText value="#{tralist.user.cpsn_name}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">备注</f:facet>
                            <h:outputText value="#{tralist.memo}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">审批</f:facet>
                            <h:commandLink action="#{checkBean.checkinfo}" >
                                <h:outputText value="审批"    rendered="#{tralist.flowMark == '1'}" />
                                <h:outputText value="审批已完成"  rendered="#{tralist.flowMark == '4'}" />
                            </h:commandLink>
                        </rich:column>
                        <f:facet name="footer">
                            <rich:dataScroller id="ds"></rich:dataScroller>
                        </f:facet>
                    </rich:dataTable>
                </div>
            </rich:panel>
        </h:form>
    </h:body>
</ui:composition>
